#include "stdafx.h"
#include "FileInfo.h"
void IntToHByte(const int buf,char* b)
{
    b[0]=(char)(buf>>24&0xff);
    b[1]=(char)(buf>>16&0xff);
    b[2]=(char)(buf>>8&0xff);
    b[3]=(char)(buf&0xff);

}

void FileInfoToHByte(const int size,char* b)
{

    char* LBZ=new char[4];
    IntToHByte(19871126,LBZ);
    char* Lsize=new char[4];
    IntToHByte(size,Lsize);
    char* Lpartsize=new char[4];
    IntToHByte(PARTSIZE,Lpartsize);
    char* LSQ=new char[4];
    IntToHByte(19871126,LSQ);
    memcpy(b,LBZ,4);
    memcpy(b+4,Lsize,4);
    memcpy(b+8,Lpartsize,4);
    memcpy(b+12,LSQ,4);
    delete LBZ;
    delete Lsize;
    delete Lpartsize;
    delete LSQ;
}